.block
  =render :partial => "admin/controls/secnav"
  .content
    %h2.title
      =pat(:all)
      =mt(:controls)
    .inner
      %table.table
        %tr
          %th.first=mat(:control, :title)
          %th=mat(:control, :is_key)
          %th=mat(:control, :frequency)
          %th=mat(:control, :fraud_related)
          %th=mat(:control, :effective_at)
          %th=mat(:control, :business_area)
          %th=mat(:control, :program_id)
          %th=mat(:control, :updated_at)
          %th.last!="&nbsp;"
        -@controls.each do |control|
          %tr
            %td.first
              %span{:title => control.description}
                =link_to h(control.title), edit_control_path(control)
              .slug&=control.slug
            %td=control.is_key
            %td=pluralize(control.frequency, control.frequency_type.to_s)
            %td=control.fraud_related
            %td=display_time(control.effective_at)
            %td&=control.business_area.title rescue "-"
            %td
              -if control.program
                =link_to control.program.display_name,
                  edit_program_path(control.program),
                  :title => control.program.description
            %td=display_time(control.updated_at)
            %td.last
              -if control.program && !control.program.company?
                =button_to pat(:implement), implement_control_path(control), :method => :post, :class => :button_to
                ="|"
              =button_to pat(:edit), edit_control_path(control), :method => :get, :class => :button_to
              ="|"
              =button_to pat(:delete), control, :method => :delete, :class => :button_to
      .actions-bar.wat-cf
        .actions!="&nbsp;"

-render_for :sidebar, :partial => "base/sidebar"
-render_for :sidebar, :partial => "base/control_nav"
